CC -cThen type:
CC -shared -o libmylib.so <list your objects here>For example:
CC -shared -o libmylib.so a.o b.o c.oThe CC driver passes the -l and -L options to ld. However, the CC driver doesn't pass most ld options. If you want to specify other options, first determine the options that you must pass to ld via a direct invocation. These options include:
-init _main -fini _fini -hidden_symbol _main -hidden_symbol _fini -hidden_symbol __head -hidden_symbol __endlinkAlso, you must link /usr/lib/c++init.o. To add -delay_load -lbother, for example, the result is similar to the following:
ld -shared -o libmylib.so a.o b.o c.o /usr/lib/c++init.o -fini _fini -hidden_symbol _main -hidden_symbol _fini -hidden_symbol __head -hidden_symbol __endlink -delay_load -delay_load -lbother